#include "BigNumber.h"
#include <regex>
#include <math.h>
#include <stdlib.h>
#include <sstream>


/**
*Empty Contractor 
**/
big_number::big_number()
{
	init("0");
}

/**
*string Contractor 
**/
big_number::big_number( string str)
{
	init( str);
}

/**
*dumy Contractor for use in child class
**/
big_number::big_number( int a, int b) {}

/**
*Copy Contractor 
**/
big_number::big_number(const big_number& src)
{
	_arr_size = src._arr_size;
	_sign = src._sign;
	_fractionalPart = src._fractionalPart;
//	free(_num_array);
	_num_array = (unsigned long*) malloc( _arr_size*sizeof(unsigned long));
	
	if ( _num_array == NULL)
		throw exception(); //TODO def execption can't allocate memory

	memcpy(_num_array, src._num_array, _arr_size*sizeof(unsigned long));
}

/**
* Destroyer
**/
big_number::~big_number()
{
	free(this-> _num_array);
}